/**
 * @BitmapNums.as
 * 
 * @author sodaChen mail:sujun10#21cn.com
 * @version 1.0
 * <br>Copyright (C), 2010 asFrame.com
 * <br>This program is protected by copyright laws.
 * <br>Program Name:挂机冒险
 * <br>Date:2014-6-16
 */
package com.asframe.display.nums
{
	import com.asframe.pool.IPoolableObjectFactory;
	
	import flash.display.BitmapData;
	
	/**
	 * 图片数字组合的对象工厂
	 * @author sodaChen
	 * Date:2014-6-16
	 */
	public class BitmapNumsFactory implements IPoolableObjectFactory
	{
		private var bitmapDatas:Vector.<BitmapData>;
		private var maxLen:int;
		private var align:int;
		private var isShowZero:Boolean;
		
		public function BitmapNumsFactory(bitmapDatas:Vector.<BitmapData>,align:int = 0,maxLen:int = 10,isShowZero:Boolean = false)
		{
			this.bitmapDatas = bitmapDatas;
			this.align = align;
			this.maxLen = maxLen;
			this.isShowZero = isShowZero;
		}
		
		public function makeObject():*
		{
			var nums:BitmapNums = new BitmapNums();
			nums.initNums(bitmapDatas,maxLen,isShowZero);
			return nums;
		}
		
		public function destroyObject(obj:*):void
		{
		}
		
		public function activateObject(obj:*):void
		{
			obj.x = 0;
			obj.y = 0;
			obj.alpha = 1;
		}
		
		public function passivateObject(obj:*):void
		{
			if(obj.parent != null)
				obj.parent.removeChild(obj);
		}
	}
}